/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.semi.lex;

import com.semi.util.StringUtil;

/**
 *
 * @author liaoyq
 */
public class Token {
    public final static int ID =256,
    INT = 257,
    FLOAT = 258,
    STRING = 259,
    KEYWORD = 260,
    AND     = 261,  
    EQ      = 262,  /* == */  
    GE      = 263,  
    LE      = 264,  
    MINUS   = 265,  
    NE      = 266,  
    OR      = 267,  
    FALSE   = 268,  
    TRUE    = 269,
    IPV4    = 270,
    IPV6    = 280,
    FINIT   = 300;
    protected int tag;
    protected String value;    
    public static final Token 
        and  = new Token(Token.AND,"&&"),   or = new Token(Token.OR,"||"),
            eq = new Token(Token.EQ,"=="), ne = new Token(Token.NE,"!="),
            le = new Token(Token.LE,"<="),ge = new Token(Token.GE,">="),
            True = new Token(Token.TRUE,"true"),False = new Token(Token.FALSE,"false");    
    public Token(int t,String v){
        tag = t;
        value = v;
    }    
    public int tag(){ return tag; }

    public String toString(){
        return value;
    }
}
